Smart devices, such as smartphones and wearables, have become omnipresent in every aspect of human life. Nowadays, the role of smart devices is not limited to making phone calls and messaging only. They are integrated into various applications from home security to health care to military [15], [57], [67]. Since smart devices seamlessly integrate the physical world with the cyber world via their sensors (e.g., light sensor, accelerometer, and gyroscope), they provide more efficient and user-friendly applications [34], [38], [79], [52], [45]. On the other hand, while the number of applications using different sensors [35] is increasing and new devices offer more sensors, the presence of sensors has opened novel ways to exploit the smart devices [72]. Attackers can exploit the sensors in many different ways. For example, they can: trigger existing malware on a device with a simple flashlight [25]; use a sensor (e.g., light sensor) to leak sensitive information by using motion sensors such as an accelerometer and a gyroscope; or record or steal sensitive information from other nearby devices (e.g., computers, keyboards) or people [8], [81], [23], [39]. They can even transfer specific malware using sensors as a communication channel [72]. Such sensor-based threats have become more serious with the rapid growth of apps utilizing many sensors [4].